import Vue from 'vue'
import Router from 'vue-router'
import Login from '../components/Login.vue'

Vue.use(Router)
const routes = [
    {
        path: '/login',
        hidden:true,
        name:'首页',
        component: Login,
    },
    {
        path: '/',
        hidden:true,
        name:'login',
        redirect: '/login'
    },
    {
        path: '/error',
        hidden:true,
        name:'404',
        component: () => import('@/views/404.vue')
    },
    {
        path: '/home',
        name:'学生管理',
        iconClass:'fa fa-users',
        redirect:'/home/student',
        component: () => import('@/views/Home.vue'),
        children:[
            {
                path:'/home/student',
                name:'学生列表',
                iconClass:'fa fa-list',
                component:() => import('@/components/students/StudentList')
            },
            {
                path:'/home/info',
                name:'信息列表',
                iconClass:'fa fa-list-alt',
                component:() => import('@/components/students/InfoList')
            },
            {
                path:'/home/work',
                name:'作业列表',
                iconClass:'fa fa-list-ul',
                component:() => import('@/components/students/WorkList')
            },         
        ]
    },
    {
        path: '/date',
        name:'数据分析',
        iconClass:'fa fa-bar-chart',
        component: () => import('@/views/Home.vue'),
        children:[
            {
                path:'/date/dataview',
                name:'数据概览',
                iconClass:'fa fa-bar-chart',
                component:() => import('@/components/dataAnalysis/DataView')
            },
            {
                path:'/date/mapview',
                name:'地图概览',
                iconClass:'fa fa-line-chart',
                component:() => import('@/components/dataAnalysis/MapView')
            },
            {
                path:'/date/score',
                name:'分数地图',
                iconClass:'fa fa-line-chart',
                component:() => import('@/components/dataAnalysis/ScoreMap')
            },
            {
                path:'/date/travel',
                name:'旅游地图',
                iconClass:'fa fa-line-chart',
                component:() => import('@/components/dataAnalysis/TravelMap')
            }
            
        ]
    },
    {
        path: '/users',
        name:'用户中心',
        iconClass:'fa fa-user',
        component: () => import('@/views/Home.vue'),
        children:[
            {
                path:'/users/user',
                name:'权限管理',
                iconClass:'fa fa-line-chart',
                component:() => import('@/components/users/User')
            }
        ]
    },
    
]
const router = new Router({
    routes,
    mode: 'history'
})
export default router